const { chromium } = require('playwright');
var log = require('winston');
const testingOA = async () => {
     const browser = await chromium.launch(headless=false);//模拟打开浏览器
     const page = await browser.newPage();//模拟打开一个页签
     await page.goto('http://192.168.8.104/');
     await page.locator('//input[@placeholder="请输入用户名"]').fill('admin');
     await page.locator('//input[@placeholder="请输入密码"]').fill('104');
     await page.click('//input[@id="submitBtn"]');
     log.info('登录成功');

     await page.goto('http://192.168.8.104/jsp/portal/index.jsp#TopMenu=1&LeftMenu=0&Tree=9a3a1be3d1b64939a2f00c54b33bd474');

     await page.locator('//*[text()="xurong"]').click();

     log.info('关闭修改密码弹窗');

     await page.close();
     await browser.close();
 };

testingOA();

